#define _CRT_SECURE_NO_WARNINGS 1
#include"Sort.h"

void TestBubbletSort()
{
	int a[] = { 2,4,1,7,8,3,9,2 };
	BubbleSort(a,8);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestInsertSort()
{
	int a[] = { 2,4,1,7,8,3,9,2 };
	InsertSort(a, 8);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestShellSort()
{
	int a[] = { 9,1,2,5,7,4,6,3,5 };
	ShellSort(a,9);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestHeapSort()
{
	int a[] = { 9,1,2,5,7,4,6,3,5 };
	HeapSort(a, 9);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestSelectSort()
{
	int a[] = { 9,1,2,5,7,4,6,3,5 };
	SelectSort(a, sizeof(a) / sizeof(int));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestQuickSort()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	QuickSort(a, 0,(sizeof(a) / sizeof(int))-1);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestQuickSortNonR()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	QuickSortNonR(a, 0, (sizeof(a) / sizeof(int)) - 1);
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestMergeSort()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
	MergeSort(a,(sizeof(a) / sizeof(int)));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestMergeSortNonR()
{
	int a[] = { 6,1,2,7,9,3,4,5,10,8,11 };
	//int a[] = {10,6,7,1,3,9,4,2};
	MergeSortNonR(a, (sizeof(a) / sizeof(int)));
	PrintArray(a, sizeof(a) / sizeof(int));
}
void TestCountSort()
{
	int a[] = { 6,1,2,9,4,2,4,1,4,-5,-5,-3,6};
	//int a[] = {10,6,7,1,3,9,4,2};
	CountSort(a, (sizeof(a) / sizeof(int)));
	PrintArray(a, sizeof(a) / sizeof(int));
}
int main()
{
	TestBubbletSort();
	TestInsertSort();
	TestShellSort();
	TestHeapSort();
	TestSelectSort();
	TestQuickSort();
	TestQuickSortNonR();
	TestMergeSort();
	TestMergeSortNonR();
	TestCountSort();
	return 0;
}